<!DOCTYPE html>
<html>
<head><title>参数配置</title>
    <#include "../common/common.ftl"/>
    <link rel="stylesheet" href="/style/contractForm.css" media="all">
</head>
<body>
<div class="layui-fluid">
    <form class="layui-form" id="dataForm">
        <input type="hidden" name="parameterId" value="${(parameter.id)!}"/>
        <div class="layui-card">
            <div class="layui-card-header">一、参数配置基本信息</div>
            <div class="layui-card-body">
                <div class="layui-form-item">
                    <label class="layui-form-labelLong jmdf-color-red">参数名称：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                               lay-verify="required" name="name" value="${(parameter.name)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">参数备注：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off"
                               name="memo" value="${(parameter.memo)!}"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-card">
            <div class="layui-card-header">二、参数配置【<span class="jmdf-color-red">除“过渡补助费单价”其余单位均为“元/㎡”</span>】</div>
            <div class="layui-card-body">
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">车位维修基金标准单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="35" name="cwwxPrice" value="${(parameter.cwwxPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">车位维修基金本次单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="35" name="cwbcwxPrice" value="${(parameter.cwbcwxPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <#--商业安置不足单价-->
        <div class="layui-card">
            <div class="layui-card-header">三、【商业】参数配置【<span class="jmdf-color-red">*正数扩购负数安置不足*</span>】</div>
            <div class="layui-card-body">
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">商业店面安置不足单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="syDmAzSyAzBzPrice" value="${(parameter.syDmAzSyAzBzPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">商业商场安置不足单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="syScAzSyAzBzPrice" value="${(parameter.syScAzSyAzBzPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">商业二层安置不足单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="syTwoFloorAzSyAzBzPrice" value="${(parameter.syTwoFloorAzSyAzBzPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">商业写字楼安置不足单价</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="syXzlAzSyAzBzPrice" value="${(parameter.syXzlAzSyAzBzPrice)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong red">开间≤3.3米应缴款</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="kjYjMoney" value="${(parameter.kjYjMoney)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong red">跨街区安置应缴款</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="0" name="kqjYjMoney" value="${(parameter.kqjYjMoney)!}" lay-verify="bigDecimal"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <#--一层商业扩购部分-->
        <div class="layui-card">
            <div class="layui-card-header">四、【一层商业】扩购面积区间及单价配置【<span class="jmdf-color-red">所有数据全部填写系统才会保存，否则自动删除!</span>】</div>
            <div class="layui-card-body">
                <table class="layui-table" id="overAreaOneFloorSyTable">
                    <tr class="layui-bg-gray">
                        <th style="text-align: center;">最小面积(不含)<span class="jmdf-color-red">(㎡)</span></th>
                        <th style="text-align: center;">最大面积(含)<span class="jmdf-color-red">(㎡)</span></th>
                        <th style="text-align: center;">房源购买单价<span class="jmdf-color-red">(元)</span></th>
                        <th style="text-align: center;">排序号<br/><span class="jmdf-color-red">请按面积区间由小到大排序</span></th>
                    </tr>
                    <#if (overAreaOneFloorSyPriceList?size == 0)>
                        <tr>
                            <td style="text-align: center;">
                                <input type="text" name="oneFloorSyMinArea" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="oneFloorSyMaxArea" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="oneFloorSyPrice" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="oneFloorSySortNum" class="layui-input" value="" />
                            </td>
                        </tr>
                    <#else>
                        <#list overAreaOneFloorSyPriceList as overAreaOneFloorSyPrice>
                            <tr>
                                <td style="text-align: center;">
                                    <input type="text" name="oneFloorSyMinArea" class="layui-input" value="${(overAreaOneFloorSyPrice.minArea)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="oneFloorSyMaxArea" class="layui-input" value="${(overAreaOneFloorSyPrice.maxArea)!}" />
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="oneFloorSyPrice" class="layui-input" value="${(overAreaOneFloorSyPrice.price)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="oneFloorSySortNum" class="layui-input" value="${(overAreaOneFloorSyPrice.sortNum)!}" />
                                </td>
                            </tr>
                        </#list>
                    </#if>
                </table>
                <div align="center"><input type="button" id="oneFloorSyAddRow" class="layui-btn" value="添加新行"/></div>
            </div>
        </div>
        <#--二层商业扩购部分-->
        <div class="layui-card">
            <div class="layui-card-header">五、【二层商业】扩购面积区间及单价配置【<span class="jmdf-color-red">所有数据全部填写系统才会保存，否则自动删除!</span>】</div>
            <div class="layui-card-body">
                <table class="layui-table" id="overAreaTwoFloorSyTable">
                    <tr class="layui-bg-gray">
                        <th style="text-align: center;">最小面积(不含)<span class="jmdf-color-red">(㎡)</span></th>
                        <th style="text-align: center;">最大面积(含)<span class="jmdf-color-red">(㎡)</span></th>
                        <th style="text-align: center;">房源购买单价<span class="jmdf-color-red">(元)</span></th>
                        <th style="text-align: center;">排序号<br/><span class="jmdf-color-red">请按面积区间由小到大排序</span></th>
                    </tr>
                    <#if (overAreaTwoFloorSyPriceList?size == 0)>
                        <tr>
                            <td style="text-align: center;">
                                <input type="text" name="twoFloorSyMinArea" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="twoFloorSyMaxArea" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="twoFloorSyPrice" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="twoFloorSySortNum" class="layui-input" value="" />
                            </td>
                        </tr>
                    <#else>
                        <#list overAreaTwoFloorSyPriceList as overAreaTwoFloorSyPrice>
                            <tr>
                                <td style="text-align: center;">
                                    <input type="text" name="twoFloorSyMinArea" class="layui-input" value="${(overAreaTwoFloorSyPrice.minArea)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="twoFloorSyMaxArea" class="layui-input" value="${(overAreaTwoFloorSyPrice.maxArea)!}" />
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="twoFloorSyPrice" class="layui-input" value="${(overAreaTwoFloorSyPrice.price)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="twoFloorSySortNum" class="layui-input" value="${(overAreaTwoFloorSyPrice.sortNum)!}" />
                                </td>
                            </tr>
                        </#list>
                    </#if>
                </table>
                <div align="center"><input type="button" id="twoFloorSyAddRow" class="layui-btn" value="添加新行"/></div>
            </div>
        </div>
        <#--商场扩购部分-->
        <div class="layui-card">
            <div class="layui-card-header">六、【商场】扩购面积区间及单价配置【<span class="jmdf-color-red">所有数据全部填写系统才会保存，否则自动删除!</span>】</div>
            <div class="layui-card-body">
                <table class="layui-table" id="overAreaScTable">
                    <tr class="layui-bg-gray">
                        <th style="text-align: center;">最小面积(不含)<span class="jmdf-color-red">(㎡)</span></th>
                        <th style="text-align: center;">最大面积(含)<span class="jmdf-color-red">(㎡)</span></th>
                        <th style="text-align: center;">房源购买单价<span class="jmdf-color-red">(元)</span></th>
                        <th style="text-align: center;">排序号<br/><span class="jmdf-color-red">请按面积区间由小到大排序</span></th>
                    </tr>
                    <#if (overAreaScPriceList?size == 0)>
                        <tr>
                            <td style="text-align: center;">
                                <input type="text" name="scMinArea" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="scMaxArea" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="scPrice" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="scSortNum" class="layui-input" value="" />
                            </td>
                        </tr>
                    <#else>
                        <#list overAreaScPriceList as overAreaScPrice>
                            <tr>
                                <td style="text-align: center;">
                                    <input type="text" name="scMinArea" class="layui-input" value="${(overAreaScPrice.minArea)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="scMaxArea" class="layui-input" value="${(overAreaScPrice.maxArea)!}" />
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="scPrice" class="layui-input" value="${(overAreaScPrice.price)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="scSortNum" class="layui-input" value="${(overAreaScPrice.sortNum)!}" />
                                </td>
                            </tr>
                        </#list>
                    </#if>
                </table>
                <div align="center"><input type="button" id="scAddRow" class="layui-btn" value="添加新行"/></div>
            </div>
        </div>
        <#--写字楼扩购部分-->
        <div class="layui-card">
            <div class="layui-card-header">七、【写字楼】扩购面积区间及单价配置【<span class="jmdf-color-red">所有数据全部填写系统才会保存，否则自动删除!</span>】</div>
            <div class="layui-card-body">
                <table class="layui-table" id="overAreaXzlTable">
                    <tr class="layui-bg-gray">
                        <th style="text-align: center;">最小面积(不含)<span class="jmdf-color-red">(㎡)</span></th>
                        <th style="text-align: center;">最大面积(含)<span class="jmdf-color-red">(㎡)</span></th>
                        <th style="text-align: center;">房源购买单价<span class="jmdf-color-red">(元)</span></th>
                        <th style="text-align: center;">排序号<br/><span class="jmdf-color-red">请按面积区间由小到大排序</span></th>
                    </tr>
                    <#if (overAreaXzlPriceList?size == 0)>
                        <tr>
                            <td style="text-align: center;">
                                <input type="text" name="xzlMinArea" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="xzlMaxArea" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="xzlPrice" class="layui-input" value="" />
                            </td>
                            <td style="text-align: center;">
                                <input type="text" name="xzlSortNum" class="layui-input" value="" />
                            </td>
                        </tr>
                    <#else>
                        <#list overAreaXzlPriceList as overAreaXzlPrice>
                            <tr>
                                <td style="text-align: center;">
                                    <input type="text" name="xzlMinArea" class="layui-input" value="${(overAreaXzlPrice.minArea)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="xzlMaxArea" class="layui-input" value="${(overAreaXzlPrice.maxArea)!}" />
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="xzlPrice" class="layui-input" value="${(overAreaXzlPrice.price)!}"/>
                                </td>
                                <td style="text-align: center;">
                                    <input type="text" name="xzlSortNum" class="layui-input" value="${(overAreaXzlPrice.sortNum)!}" />
                                </td>
                            </tr>
                        </#list>
                    </#if>
                </table>
                <div align="center"><input type="button" id="xzlAddRow" class="layui-btn" value="添加新行"/></div>
            </div>
        </div>
        <button style="display: none;" class="layui-btn" id="submitBtn" name="submitBtn" lay-submit="" lay-filter="submit">立即提交</button>
    </form>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['form', "verify", "dataDict"], function () {
        var form = layui.form, $ = layui.jquery, verify = layui.verify,parentIndex = parent.layer.getFrameIndex(window.name);

        //增加新行
        $("#addRow").click(function () {
            var rowIndex = $("#overAreaTable tr").length - 1;
            $("#overAreaTable tr:last").clone().insertAfter($("#overAreaTable tr:eq(" + rowIndex + ")"));
            $("#overAreaTable tr:last input").each(function () {
                $(this).val("");
            });
            form.render();
        });

        //一层商业增加新行
        $("#oneFloorSyAddRow").click(function () {
            var rowIndex = $("#overAreaOneFloorSyTable tr").length - 1;
            $("#overAreaOneFloorSyTable tr:last").clone().insertAfter($("#overAreaOneFloorSyTable tr:eq(" + rowIndex + ")"));
            $("#overAreaOneFloorSyTable tr:last input").each(function () {
                $(this).val("");
            });
            form.render();
        });

        //二层商业增加新行
        $("#twoFloorSyAddRow").click(function () {
            var rowIndex = $("#overAreaTwoFloorSyTable tr").length - 1;
            $("#overAreaTwoFloorSyTable tr:last").clone().insertAfter($("#overAreaTwoFloorSyTable tr:eq(" + rowIndex + ")"));
            $("#overAreaTwoFloorSyTable tr:last input").each(function () {
                $(this).val("");
            });
            form.render();
        });

        //商场增加新行
        $("#scAddRow").click(function () {
            var rowIndex = $("#overAreaScTable tr").length - 1;
            $("#overAreaScTable tr:last").clone().insertAfter($("#overAreaScTable tr:eq(" + rowIndex + ")"));
            $("#overAreaScTable tr:last input").each(function () {
                $(this).val("");
            });
            form.render();
        });

        //写字楼增加新行
        $("#xzlAddRow").click(function () {
            var rowIndex = $("#overAreaXzlTable tr").length - 1;
            $("#overAreaXzlTable tr:last").clone().insertAfter($("#overAreaXzlTable tr:eq(" + rowIndex + ")"));
            $("#overAreaXzlTable tr:last input").each(function () {
                $(this).val("");
            });
            form.render();
        });
        //监听提交
        form.on('submit(submit)', function (data) {
            $.ajax({
                url: 'dataFormSave',
                type: 'post',
                data: $("#dataForm").serialize(),
                success: function (data) {
                    if (data.code == "0001") {
                        layer.alert(data.message);
                        parent.loadData();
                        parent.layer.close(parentIndex);
                    } else {
                        layer.msg(data.message, {anim: 6, icon: 2, time: 3000});
                    }
                }
            });
            return false;
        });

    });
</script>
</body>
</html>